package cn.ubeta.b2c.safe;

import android.content.Intent;

/**
 * Created by denny on 2016/11/10.
 */

public class IntentHelper {

    public static int getInt(Intent intent, String key) {
        int value = 0;
        try {
            value = intent.getIntExtra(key, value);
        } catch (NoClassDefFoundError e) {
        } catch (NullPointerException e) {
        }
        return value;
    }

    public static String getString(Intent intent, String key) {
        String value = null;
        try {
            value = intent.getStringExtra(key);
        } catch (NoClassDefFoundError e) {
        } catch (NullPointerException e) {
        }
        return value;
    }

    public static String getDataString(Intent intent) {
        String value = null;
        try {
            value = intent.getDataString();
        } catch (NoClassDefFoundError e) {
        } catch (NullPointerException e) {
        }
        return value;
    }

}
